<template>
  <a-drawer
    width="45%"
    :title="formTitle"
    :label-col="4"
    :wrapper-col="14"
    :visible="open"
    :body-style="{ height: 'calc(100vh - 100px)', overflow: 'auto' }"
    @close="cancel"
  >
    <a-form-model ref="form" :model="form" :rules="rules" layout="vertical">
      <a-spin :spinning="spinning" :delay="delayTime" tip="Loading...">
        <a-row :gutter="32">
          <a-col :span="12">
            <a-form-model-item label="记录内容" prop="takes">
              <a-textarea
                v-model="form.takes"
                placeholder="请输入记录内容"
                :rows="4"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="图片" prop="images">
              <a-textarea
                v-model="form.images"
                placeholder="请输入图片"
                :rows="4"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="附件" prop="files">
              <a-input v-model="form.files" placeholder="请输入附件" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="是否标记" prop="mark">
              <a-input-number
                v-model="form.mark"
                :min="0"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="重要级别" prop="level">
              <a-select
                placeholder="请选择重要级别"
                v-model="form.level"
                :getPopupContainer="
                  (triggerNode) => {
                    return triggerNode.parentNode || document.body;
                  }
                "
                style="width: 100%"
                allow-clear
              >
                <a-select-option
                  v-for="(d, index) in levelOptions"
                  :key="index"
                  :value="d.dictValue"
                  >{{ d.dictLabel }}</a-select-option
                >
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="联系方式" prop="ideasType">
              <a-select
                placeholder="请选择联系方式"
                v-model="form.ideasType"
                :getPopupContainer="
                  (triggerNode) => {
                    return triggerNode.parentNode || document.body;
                  }
                "
                style="width: 100%"
                allow-clear
              >
                <a-select-option
                  v-for="(d, index) in ideasTypeOptions"
                  :key="index"
                  :value="d.dictValue"
                  >{{ d.dictLabel }}</a-select-option
                >
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="下次跟进时间" prop="nextTime">
              <a-date-picker
                v-model="form.nextTime"
                valueFormat="YYYY-MM-DD"
                :show-today="true"
                placeholder="选择日期"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="备注" prop="remark">
              <a-textarea
                v-model="form.remark"
                placeholder="请输入备注"
                :rows="4"
              />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-spin>
      <div class="bottom-control">
        <a-space>
          <a-button @click="cancel"> 取消 </a-button>
          <a-button type="primary" @click="submitForm"> 保存 </a-button>
        </a-space>
      </div>
    </a-form-model>
  </a-drawer>
</template>
<script>
import BizCustomerShadowInfoEditForm from "./BizCustomerShadowInfoForm";
export default {
  ...BizCustomerShadowInfoEditForm,
};
</script>
